#ifndef SSHSHELLCONNECTION_H
#define SSHSHELLCONNECTION_H

#include <QObject>
#include <mutex>

#include "QLibSsh_global.h"

class QLIBSSH_EXPORT SshShellConnection final : public QObject
{
    Q_OBJECT

public:
    explicit SshShellConnection(SshLoginKeys loginKeys, QObject* parent = nullptr);
    ~SshShellConnection() override;

public slots:
    void ConnectSsh();
    void SendCommand(const std::string& command);
    void DisconnectSsh();

signals:
    void SshConnected();
    void SshDisconnected();
    void SshStandardError(const std::string& error);
    void SshStandardOutput(const std::string& output);
    void SshExecStarted();
    void SshExecFinished();

private:
    std::mutex mMutex;
    bool mIsConnect = {false};
    bool mIsExecing {false};
    SshLoginKeys mLoginKeys;
    std::string mCommand {};
};

#endif // SSHSHELLCONNECTION_H
